	public function edit(){
		${$tableName}Model = D('{$TableName}');
		if(IS_POST){
			$data=I('post.'); 
			if (!${$tableName}Model ->create()) {
				$this->ajaxJson(${$tableName}Model->geterror(), 1);
			}
			$formFieldArr=${$tableName}Model->formFieldDict();
			foreach($formFieldArr as $k=>$v){
	          if($v['inType']=='checkbox' || ($v['inType']=='select' && $v['multiple']==1 && $v['field_comma_split']==1)){
	             if(isset($data[$k])){
			        if(is_array($data[$k]) && count($data[$k])){
			            ${$tableName}Model->$k=implode(',',$data[$k]);
			        }	
	             }
	          }
		    }

			$flag = ${$tableName}Model ->save();
			if($flag){
				$this->ajaxJson('编辑成功', 0);			
			}else{
				$this->ajaxJson('编辑失败', 1);			
			}
		}else{
			$id = I('id'); 
			${$tableName} = ${$tableName}Model->find($id);
			$this->assign('{$tableName}', ${$tableName});
			$this->display();
		}
	}